<template>
  <div class="register-page">
    <UserForm isRegister="true" @onSubmit="onSubmit" />
  </div>
</template>

<script>
import { registerAPI } from '@/api/user'
import UserForm from '@/components/UserForm.vue'
export default {
  name: 'RegisterPage',
  data () {
    return {
      username: '',
      password: ''
    }
  },
  methods: {
    async onSubmit (values) {
      await registerAPI(values)
      this.$toast('注册成功')
      this.$router.push('/login')
    }
  },
  components: { UserForm }
}
</script>

<style lang="less" scoped>
.link {
  color: #069;
  font-size: 12px;
  padding-right: 20px;
  float: right;
}
</style>
